<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>移动端登录页面原型</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .container {
            display: flex;
            max-width: 1200px;
            width: 100%;
            gap: 40px;
            align-items: center;
        }

        .phone-mockup {
            width: 375px;
            height: 812px;
            background: #000;
            border-radius: 40px;
            padding: 8px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            position: relative;
        }

        .phone-screen {
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 32px;
            overflow: hidden;
            position: relative;
        }

        .status-bar {
            height: 44px;
            background: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            color: white;
            font-size: 14px;
            font-weight: 600;
        }

        .login-container {
            padding: 60px 30px 40px;
            height: calc(100% - 44px);
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .logo-section {
            text-align: center;
            margin-bottom: 50px;
        }

        .logo {
            width: 80px;
            height: 80px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            color: white;
            backdrop-filter: blur(10px);
        }

        .app-title {
            color: white;
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .app-subtitle {
            color: rgba(255, 255, 255, 0.8);
            font-size: 16px;
        }

        .login-form {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 24px;
            padding: 30px;
            backdrop-filter: blur(20px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }

        .form-group {
            margin-bottom: 24px;
        }

        .form-label {
            display: block;
            color: #333;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .form-input {
            width: 100%;
            height: 56px;
            border: 2px solid #e1e5e9;
            border-radius: 16px;
            padding: 0 20px;
            font-size: 16px;
            transition: all 0.3s ease;
            background: white;
        }

        .form-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .form-input.error {
            border-color: #ff4757;
        }

        .login-button {
            width: 100%;
            height: 56px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 10px;
        }

        .login-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
        }

        .login-button:active {
            transform: translateY(0);
        }

        .login-button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .forgot-password {
            text-align: center;
            margin-top: 20px;
        }

        .forgot-link {
            color: #667eea;
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
        }

        .forgot-link:hover {
            text-decoration: underline;
        }

        .design-notes {
            flex: 1;
            background: white;
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            max-height: 700px;
            overflow-y: auto;
        }

        .notes-title {
            font-size: 24px;
            font-weight: 700;
            color: #333;
            margin-bottom: 20px;
            text-align: center;
        }

        .note-section {
            margin-bottom: 25px;
        }

        .note-title {
            font-size: 18px;
            font-weight: 600;
            color: #667eea;
            margin-bottom: 10px;
        }

        .note-content {
            color: #666;
            line-height: 1.6;
            font-size: 14px;
        }

        .feature-list {
            list-style: none;
            padding: 0;
        }

        .feature-list li {
            padding: 5px 0;
            position: relative;
            padding-left: 20px;
        }

        .feature-list li:before {
            content: "✓";
            position: absolute;
            left: 0;
            color: #667eea;
            font-weight: bold;
        }

        .color-palette {
            display: flex;
            gap: 10px;
            margin: 15px 0;
        }

        .color-item {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            border: 2px solid #fff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .interaction-demo {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 15px;
            margin: 15px 0;
        }

        .demo-button {
            background: #667eea;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            margin: 5px;
        }

        @media (max-width: 768px) {
            .container {
                flex-direction: column;
                gap: 20px;
            }

            .phone-mockup {
                width: 320px;
                height: 640px;
            }

            .design-notes {
                max-height: 400px;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <!-- 手机原型 -->
        <div class="phone-mockup">
            <div class="phone-screen">
                <div class="status-bar">
                    <span>9:41</span>
                    <span>📶 📶 📶 🔋</span>
                </div>

                <div class="login-container">
                    <div class="logo-section">
                        <div class="logo">📱</div>
                        <h1 class="app-title">欢迎回来</h1>
                        <p class="app-subtitle">登录您的账户</p>
                    </div>

                    <form class="login-form" id="loginForm">
                        <div class="form-group">
                            <label class="form-label" for="username">账号</label>
                            <input type="text" id="username" class="form-input" placeholder="请输入手机号或邮箱" required>
                        </div>

                        <div class="form-group">
                            <label class="form-label" for="password">密码</label>
                            <input type="password" id="password" class="form-input" placeholder="请输入密码" required>
                        </div>

                        <button type="submit" class="login-button" id="loginBtn">
                            登录
                        </button>

                        <div class="forgot-password">
                            <a href="#" class="forgot-link" onclick="showForgotPassword()">忘记密码？</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <!-- 设计说明 -->
        <div class="design-notes">
            <h2 class="notes-title">🎨 设计说明</h2>

            <div class="note-section">
                <h3 class="note-title">设计理念</h3>
                <div class="note-content">
                    采用现代简约设计风格，通过渐变背景和毛玻璃效果营造科技感。整体布局简洁明了，符合移动端用户的使用习惯。
                </div>
            </div>

            <div class="note-section">
                <h3 class="note-title">色彩搭配</h3>
                <div class="color-palette">
                    <div class="color-item" style="background: #667eea;"></div>
                    <div class="color-item" style="background: #764ba2;"></div>
                    <div class="color-item" style="background: #ffffff;"></div>
                    <div class="color-item" style="background: #f8f9fa;"></div>
                </div>
                <div class="note-content">
                    主色调采用蓝紫渐变，传达专业和信任感。白色卡片提供良好的对比度，确保内容清晰可读。
                </div>
            </div>

            <div class="note-section">
                <h3 class="note-title">交互特性</h3>
                <div class="interaction-demo">
                    <button class="demo-button" onclick="demoInputFocus()">输入框聚焦效果</button>
                    <button class="demo-button" onclick="demoButtonHover()">按钮悬停效果</button>
                    <button class="demo-button" onclick="demoFormValidation()">表单验证</button>
                </div>
                <ul class="feature-list">
                    <li>输入框聚焦时边框高亮</li>
                    <li>按钮悬停时上浮效果</li>
                    <li>实时表单验证</li>
                    <li>加载状态反馈</li>
                    <li>错误状态提示</li>
                </ul>
            </div>

            <div class="note-section">
                <h3 class="note-title">布局特点</h3>
                <ul class="feature-list">
                    <li>垂直居中布局，适配不同屏幕</li>
                    <li>卡片式设计，层次分明</li>
                    <li>合理的留白空间</li>
                    <li>大按钮设计，便于点击</li>
                    <li>状态栏模拟真实手机</li>
                </ul>
            </div>

            <div class="note-section">
                <h3 class="note-title">技术实现</h3>
                <div class="note-content">
                    <strong>响应式设计：</strong>使用flexbox布局，适配不同屏幕尺寸<br>
                    <strong>视觉效果：</strong>CSS渐变、毛玻璃效果、阴影<br>
                    <strong>交互反馈：</strong>CSS过渡动画、JavaScript事件处理<br>
                    <strong>表单验证：</strong>HTML5验证 + 自定义验证逻辑
                </div>
            </div>
        </div>
    </div>

    <script>
        // 表单验证和交互
        const loginForm = document.getElementById('loginForm');
        const usernameInput = document.getElementById('username');
        const passwordInput = document.getElementById('password');
        const loginBtn = document.getElementById('loginBtn');

        // 输入框验证
        function validateInput(input) {
            const value = input.value.trim();
            if (value.length < 3) {
                input.classList.add('error');
                return false;
            } else {
                input.classList.remove('error');
                return true;
            }
        }

        // 实时验证
        usernameInput.addEventListener('input', () => validateInput(usernameInput));
        passwordInput.addEventListener('input', () => validateInput(passwordInput));

        // 表单提交
        loginForm.addEventListener('submit', function (e) {
            e.preventDefault();

            const isUsernameValid = validateInput(usernameInput);
            const isPasswordValid = validateInput(passwordInput);

            if (isUsernameValid && isPasswordValid) {
                // 模拟登录过程
                loginBtn.textContent = '登录中...';
                loginBtn.disabled = true;

                setTimeout(() => {
                    alert('登录成功！');
                    loginBtn.textContent = '登录';
                    loginBtn.disabled = false;
                }, 2000);
            } else {
                alert('请检查输入信息');
            }
        });

        // 忘记密码
        function showForgotPassword() {
            alert('忘记密码功能演示');
        }

        // 交互演示
        function demoInputFocus() {
            usernameInput.focus();
            usernameInput.classList.add('error');
            setTimeout(() => {
                usernameInput.classList.remove('error');
            }, 2000);
        }

        function demoButtonHover() {
            loginBtn.style.transform = 'translateY(-2px)';
            loginBtn.style.boxShadow = '0 10px 20px rgba(102, 126, 234, 0.3)';
            setTimeout(() => {
                loginBtn.style.transform = 'translateY(0)';
                loginBtn.style.boxShadow = 'none';
            }, 1000);
        }

        function demoFormValidation() {
            usernameInput.value = 'test';
            passwordInput.value = '12';
            validateInput(usernameInput);
            validateInput(passwordInput);
        }
    </script>
</body>

</html>